================================================================
MechaPaint - the optional DEPTH MODEL
================================================================
Nothing in this folder is required. MechaPaint runs, paints and
makes photo materials with it empty - that is the normal state.

WHAT IT BUYS
----------------------------------------------------------------
Photo Material and Photo Mesh work out how HIGH each part of a
photo is. Without a model they infer that from brightness, which
is correct for a flat material shot flat-on under even light -
brick, fabric, stone, bark - and simply WRONG for an object lit
from one side, where the bright part is the side facing the lamp
rather than the part nearest the camera.

Measured against a sphere whose true shape is known:
    brightness only ....... 0.12
    with a depth model .... 0.99

The failure is not obvious by eye. Without a model an object
photo still produces a full, convincing-looking material; the
shape in it is just the lamp's. That is why the Photo Material
window shows a SHAPE line whenever Object is selected, and why
"Check Depth Model" beside it exists.

WHAT TO PUT HERE
----------------------------------------------------------------
One file named  depth.sentis  in this folder.

To make it:
  1. Get a monocular depth model in ONNX form. MechaPaint's
     preprocessing is written for Depth Anything v2 SMALL, fp32 -
     input "pixel_values" at 518 x 518, output "predicted_depth".
     Another model may load and run and produce nothing useful;
     "Check Depth Model" reports the tensor names it found, which
     is how you tell that apart from a maths bug.
  2. Drop the .onnx anywhere under Assets/ in the Unity editor.
  3. Select it, and in the Inspector choose
     "Serialize to StreamingAssets".
  4. Rename the result to depth.sentis and leave it in this
     folder. DELETE THE .onnx - an imported .onnx is serialized
     into the build, and this file is around 94 MB.

Do not use the int8 (27 MB) variant. It quantizes exactly the
smooth gradients this feature exists to recover.

The file is deliberately NOT committed. It is large, it is
optional, and a paint app should not ship 94 MB for a feature
most photos do not need.

CHECKING IT
----------------------------------------------------------------
Photo Material window > Object > Check Depth Model.

It runs a sphere whose true form is known and whose brightness
deliberately disagrees with that form, then reports two numbers:

  shape match      0.944 or better means it found the form.
                   Under about 0.5 means the model contributed
                   nothing and something fell back silently.
  left-right lean  0.051 or lower. The sphere is symmetric, so a
                   correct map is too. A map that is really
                   reading the LIGHTING inherits the lamp's
                   direction and leans.

Run it on both backends before trusting either - set preferGpu
off on the PhotoDepthModel component for the CPU one. They use
different operator implementations and can disagree.

TURNING DEPTH ON AT ALL - DO THIS FIRST
----------------------------------------------------------------
DEPTH IS COMPILED OUT BY DEFAULT. Out of the box the app reports
"Depth: OFF (model not loaded)" and takes the brightness path,
and no amount of dropping model files in here changes that until
both of the following are done, in this order:

  1. com.unity.ai.inference must actually be INSTALLED. It is
     listed in Packages/manifest.json at 2.6.1, which is the
     version released for Unity 6.3 (6000.3). A first open needs
     network. Check Window > Package Manager > In Project; if it
     is not there, the pin does not match your Editor version -
     look up the version for yours and change the manifest.

  2. Add    MECHAPAINT_INFERENCE    to
     Project Settings > Player > Scripting Define Symbols,
     then let Unity recompile.

WHY IT IS OFF BY DEFAULT rather than on: the package is large and
optional, and if it is missing while the code expects it, NOTHING
COMPILES - which is a strange price for a feature most photos do
not need. It shipped that way round briefly and the first open of
the project failed to build. So it fails closed instead: no
package, no depth, everything else untouched, one define to opt
in once the package is genuinely there.

Every reference to the package lives in the single file
Scripts/PBR/PhotoDepth/PhotoDepthModel.cs, which is what makes
that switch possible.
